<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const arr1 = [1, 2, 3]
    const arr2 = [1, 2, 3, 4]
    // 展开运算符 可以展开数组
    // console.log(...arr)
    function fn(...data) {
      console.log(data);
    }
    fn(...arr1)

    // 1 求数组最大值
    console.log(Math.max(...arr1));
    console.log(Math.min(...arr2));
    // 2. 合并数组
    const arr = [...arr1, ...arr2]
    console.log(arr);
  </script>
</body>

</html>